package demo3;


/**
 * @author lfg
 * @version 1.0
 */
public class 类的加载与卸载 {


    //-verbose:class 打印加载/卸载类
    public static void main(String[] args) throws ClassNotFoundException {
        for (int i = 0; i < 10; i++) {
            loader();
        }
        System.gc();

    }

    public static void loader() throws ClassNotFoundException {
        ClassLoader loader = ClassLoader.getSystemClassLoader();
        loader.loadClass("demo3.LoaderClass");
    }


}
